package com.yami.shop.platform.task;

import com.xxl.job.core.handler.annotation.XxlJob;
import com.yami.shop.personnft.common.service.NftTransferRecordService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class AssetTransferTask {

    private Logger log = LoggerFactory.getLogger(getClass());

    @Autowired
    private NftTransferRecordService nftTransferRecordService;


    /**
     * 0 0/10 4-23 * * ?
     */
    @XxlJob("startAssetTransfer")
    public void startAssetTransfer() {
        log.info("划转请求批量处理开始");
        nftTransferRecordService.doTransfer();
    }
    
    
    /**
     * 0 3/10 4-23 * * ?
     */
    @XxlJob("checkFailTransfer")
    public void checkFailTransfer() {
        log.info("检查划转失败的资产转移开始");
        nftTransferRecordService.checkTransferFail();
    }


    /**
     * 0 0 0,1,2 * * ?
     */
    @XxlJob("aloneFailTransfer")
    public void aloneFailTransfer() {
        log.info("单独处理批量转移失败的资产开始");
        nftTransferRecordService.aloneTransferFail();
    }
    
}
